//
//  ListDetailViewController.m
//  B
//
//  Created by Sunpeng on 15/11/10.
//  Copyright © 2015年 wangzhan. All rights reserved.
//

#import "ListDetailViewController.h"
#import "BaseView.h"
@interface ListDetailViewController ()<UIWebViewDelegate>
@property(nonatomic,retain)UIWebView *webView;
@end

@implementation ListDetailViewController
-(void)viewWillAppear:(BOOL)animated {
    
    
    [super viewWillAppear:animated];
    
    for (UIView *view in self.tabBarController.view.subviews) {
        if ([view isKindOfClass:[BaseView class]]) {
            view.hidden = YES;
        }
    }
}

- (void) viewWillDisappear:(BOOL)animated {
    
    [super viewWillDisappear:animated];
    for (UIView *view in self.tabBarController.view.subviews) {
        if ([view isKindOfClass:[BaseView class]]) {
            view.hidden = NO;
            
        }
    }
    
    
}
-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    //数组初始化
    self=[super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if(self){
      
        self.hidesBottomBarWhenPushed = YES;
    }
    
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"游记详情";
    NSDictionary *dict=[NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
    self.navigationController.navigationBar.titleTextAttributes = dict;
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HIGHT-64)];
    self.webView.scalesPageToFit=YES;
    self.webView.scrollView.bounces = NO;
    
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.url]];
    [self.webView setBackgroundColor:[UIColor colorWithRed:0.987 green:1.000 blue:0.806 alpha:1.000]];
    [self.webView loadRequest:request];
    self.webView.delegate=self;
    [self.view addSubview:self.webView];
    

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
